//
//  ZRScanManager.h
//  简书:https://www.jianshu.com/u/043e94ca450f
//
//  Created by 黄涛 on 2018/8/23.
//  Copyright © 2018年 黄涛(ZR:zero). All rights reserved.
//  扫一扫 

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>

@interface ZRScanManager : NSObject 

/** 初始化 */
+ (instancetype)sharedManager;

/** 摄像设备 */
@property (nonatomic , strong) AVCaptureDevice * device;
/** 输入流:设备 */
@property (nonatomic , strong) AVCaptureDeviceInput * input;
/** 输出流:元数据 使用请设置rectOfInterest(扫描区域) */
@property (nonatomic , strong) AVCaptureMetadataOutput * metaOutput;
/** 输出流:视频数据 */
@property (nonatomic , strong) AVCaptureVideoDataOutput * videoOutput;
/** 连接对象 */
@property (nonatomic , strong) AVCaptureSession * session;
/** 视频层 使用请设置Frame并添加到Layer图层 */
@property (nonatomic , strong) AVCaptureVideoPreviewLayer * videoLayer;

/** 明亮度回调 */
@property (nonatomic , copy) void (^deviceBrightnessValueBlock)(CGFloat brightnessValue);
/** 成功后的回调 */
@property (nonatomic , copy) void (^scanSuccess)(NSString * result);


/** 打开/关闭 手电筒 */
+ (void)turnTorchOn:(BOOL)isOn;

@end
